'''
Created on 15.Haz.2009

@author: okaya
'''
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'cli_signage.ui'
#
# Created: Mon Jun 15 11:49:35 2009
#      by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
import sys
import gc
import time,threading

from PyQt4 import QtCore, QtGui,QtNetwork
from PyQt4 import QtWebKit



class deneme1:
        def __init__(self, ui):
            self.ui = ui

        def getUi(self):
            return self.__ui


        def setUi(self, value):
            self.__ui = value


        def delUi(self):
            del self.__ui

        
        def text1_yaz(self):
          a=0
          font = QtGui.QFont()
          font.setPointSize(30)
          font.setWeight(75)
          font.setBold(True)
          font.OldEnglish 
          ui.label.setFont(font)
          while a<30:
                a=a+1
                test_txt=ui.label.text()
                ui.label.setText( '<font color="#FF0000" bold>'+ str(a) + "    "  + test_txt+ '</font>' )
          start_thread()

        ui = property(getUi, setUi, delUi, "Ui's Docstring")
          
          
          
def start_thread():

            
         d = threading.Thread(name='kaydir', target=kaydir)
         d.start()   
 
   
class Ui_MainWindow(object):

    def getCentralwidget(self):
        return self.__centralwidget


    def getPushButton(self):
        return self.__pushButton


    def getLabel(self):
        return self.__label


    def getGraphicsView(self):
        return self.__graphicsView


    def getWebView_2(self):
        return self.__webView_2


    def getPushButton_2(self):
        return self.__pushButton_2


    def getCalendarWidget(self):
        return self.__calendarWidget


    def getMenubar(self):
        return self.__menubar


    def getStatusbar(self):
        return self.__statusbar


    def getDeneme1(self):
        return self.__deneme1


    def setCentralwidget(self, value):
        self.__centralwidget = value


    def setPushButton(self, value):
        self.__pushButton = value


    def setLabel(self, value):
        self.__label = value


    def setGraphicsView(self, value):
        self.__graphicsView = value


    def setWebView_2(self, value):
        self.__webView_2 = value


    def setPushButton_2(self, value):
        self.__pushButton_2 = value


    def setCalendarWidget(self, value):
        self.__calendarWidget = value


    def setMenubar(self, value):
        self.__menubar = value


    def setStatusbar(self, value):
        self.__statusbar = value


    def setDeneme1(self, value):
        self.__deneme1 = value


    def delCentralwidget(self):
        del self.__centralwidget


    def delPushButton(self):
        del self.__pushButton


    def delLabel(self):
        del self.__label


    def delGraphicsView(self):
        del self.__graphicsView


    def delWebView_2(self):
        del self.__webView_2


    def delPushButton_2(self):
        del self.__pushButton_2


    def delCalendarWidget(self):
        del self.__calendarWidget


    def delMenubar(self):
        del self.__menubar


    def delStatusbar(self):
        del self.__statusbar


    def delDeneme1(self):
        del self.__deneme1

    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(800, 600)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.pushButton = QtGui.QPushButton(self.centralwidget)
        self.pushButton.setGeometry(QtCore.QRect(720, 0, 75, 23))
        self.pushButton.setObjectName("pushButton")
        self.label = QtGui.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(0, 510, 791, 41))
        self.label.setObjectName("label")
        
        
        self.graphicsView = QtGui.QGraphicsView(self.centralwidget)
        self.graphicsView.setGeometry(QtCore.QRect(20, 240, 431, 261))
        self.graphicsView.setFrameShape(QtGui.QFrame.WinPanel)
        self.graphicsView.setFrameShadow(QtGui.QFrame.Sunken)
        self.graphicsView.setObjectName("graphicsView")

        self.webView_2 = QtWebKit.QWebView(self.centralwidget)
        self.webView_2.setGeometry(QtCore.QRect(20, 10, 431, 221))
        self.webView_2.setUrl(QtCore.QUrl("http://127.0.0.1/"))
        self.webView_2.setObjectName("webView_2")
        
        
        self.pushButton_2 = QtGui.QPushButton(self.centralwidget)
        self.pushButton_2.setGeometry(QtCore.QRect(640, 0, 75, 23))
        self.pushButton_2.setObjectName("pushButton_2")
   
       

        
        self.calendarWidget = QtGui.QCalendarWidget(self.centralwidget)
        self.calendarWidget.setGeometry(QtCore.QRect(470, 260, 321, 221))
        self.calendarWidget.setGridVisible(True)
        self.calendarWidget.setNavigationBarVisible(False)
        self.calendarWidget.setDateEditEnabled(False)
        self.calendarWidget.setObjectName("calendarWidget")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 22))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        self.deneme1 = deneme1(self)
        QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL("clicked()"), MainWindow.close)
        QtCore.QObject.connect(self.pushButton_2, QtCore.SIGNAL("clicked()"),self.deneme1.text1_yaz)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton.setText(QtGui.QApplication.translate("MainWindow", "&Kapat", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setText(QtGui.QApplication.translate("MainWindow", "TextLabel", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton_2.setText(QtGui.QApplication.translate("MainWindow", "TEST", None, QtGui.QApplication.UnicodeUTF8))

    centralwidget = property(getCentralwidget, setCentralwidget, delCentralwidget, "Centralwidget's Docstring")

    pushButton = property(getPushButton, setPushButton, delPushButton, "PushButton's Docstring")

    label = property(getLabel, setLabel, delLabel, "Label's Docstring")

    graphicsView = property(getGraphicsView, setGraphicsView, delGraphicsView, "GraphicsView's Docstring")

    webView_2 = property(getWebView_2, setWebView_2, delWebView_2, "WebView_2's Docstring")

    pushButton_2 = property(getPushButton_2, setPushButton_2, delPushButton_2, "PushButton_2's Docstring")

    calendarWidget = property(getCalendarWidget, setCalendarWidget, delCalendarWidget, "CalendarWidget's Docstring")

    menubar = property(getMenubar, setMenubar, delMenubar, "Menubar's Docstring")

    statusbar = property(getStatusbar, setStatusbar, delStatusbar, "Statusbar's Docstring")

    deneme1 = property(getDeneme1, setDeneme1, delDeneme1, "Deneme1's Docstring")


def kaydir():

    try:
    
        Time_temp=time.clock()
        a=0
        b=0
        temp_label="deneme"
        print "test"
        while time.clock==time.clock:
            a=a+1
            b=b+1
            time.sleep(0.5)
            temp_label=" "+temp_label
            print temp_label
            #ui.label.setText( temp_label)
            ui.label.setText(temp_label) 
           # ui.pushButton.move(500-a,500)
            print str(b)+". thread : " + str(a)
            print time.asctime()
            if a==250:
                a=-200
                temp_label="deneme"
    except:
        print "ERROR"
        time.sleep(5)
     

  


gc.isenabled()    
app = QtGui.QApplication(sys.argv)
window = QtGui.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(window)
          
window.show()




sys.exit(app.exec_())



